import request from "@/utils/request";

/**
 * 获取当前登录人的工作中心
 */
export function getUserWokers(data = {}) {
  return request({
    method: 'POST',
    url: '/mes/mescrewmember/getUserWokers',
    data
  });
}


/**
 * 获取当前的工作中心
 */
export function getUserWoker(data = {}) {
  return request({
    method: 'POST',
    url: '/mes/mescrewmember/getUserWoker',
    data
  });
}

/**
 * 获取生产线
 */
export function getworkCenter(data = {}) {
  return request({
    method: 'POST',
    url: '/mes/mesworkshop/getList',
    data
  });
}


/**
 * 根据工作中心获取工序
 */
export function getMesprocessList(data = {}) {
  return request({
    method: 'POST',
    url: '/mes/mesprocess/getList',
    data
  });
}

/**
 * 获取停机类型
 */
export function getAndstoptypeList(data = {}) {
  return request({
    method: 'POST',
    url: '/andon/andstoptype/list',
    data
  });
}

/**
 * 获取停机原因列表
 */
export function getAndstopreasonList(data = {}) {
  return request({
    method: 'POST',
    url: '/andon/andstopreason/list',
    data
  });
}


/**
 * 获取报检类型
 */
export function getAndinspectiontypeList(data = {}) {
  return request({
    method: 'POST',
    url: '/andon/andinspectiontype/getList',
    data
  });
}


/**
 * 添加呼叫
 */
export function saveAndcall(data = {}) {
  return request({
    method: 'POST',
    url: '/andon/andcall/save',
    data
  });
}

/**
 * 根据班组获取设备
 */
export function getCrewEquipmentList(data = {}) {
  return request({
    method: 'POST',
    url: '/mes/mescrew/getCrewEquipmentList',
    data
  });
}

export function queryCallTypeForPlant(data = {}) {
  return request({
    method: 'POST',
    url: '/andon/andcalltype/queryCallTypeForPlant',
    data
  });
}

function onReachBottom() {
}
/**
 * 获取呼叫记录 分页
 */
export function getCallListByPage(data = {}) {
  return request({
    method: 'POST',
    url: '/andon/andcall/queryByPageApp',
    data
  });
}


/**
 * 修改呼叫类型
 */
export function updateCallState(data = {}) {
  return request({
    method: 'POST',
    url: '/andon/andcall/updateState',
    data
  });
}

/**
 * 复工
 */
export function resumptionCallWork(data = {}) {
  return request({
    method: 'POST',
    url: '/andon/andcall/resumptionWork',
    data
  });
}

/**
 * 详情
 */
export function getinfo(id) {
  return request({
    method: 'GET',
    url: `/andon/andcall/get/${id}`,
    data: {}
  });
}
